package com.office.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.office.system.mapper.SysReportMaterialMapper;
import com.office.system.domain.SysReportMaterial;
import com.office.system.service.ISysReportMaterialService;

/**
 * 报告素材Service业务层处理
 */
@Service
public class SysReportMaterialServiceImpl implements ISysReportMaterialService {
    @Autowired
    private SysReportMaterialMapper sysReportMaterialMapper;

    /**
     * 查询报告素材
     *
     * @param materialId 报告素材主键
     * @return 报告素材
     */
    @Override
    public SysReportMaterial selectSysReportMaterialByMaterialId(Long materialId) {
        return sysReportMaterialMapper.selectSysReportMaterialByMaterialId(materialId);
    }

    /**
     * 查询报告素材列表
     *
     * @param sysReportMaterial 报告素材
     * @return 报告素材
     */
    @Override
    public List<SysReportMaterial> selectSysReportMaterialList(SysReportMaterial sysReportMaterial) {
        return sysReportMaterialMapper.selectSysReportMaterialList(sysReportMaterial);
    }

    /**
     * 新增报告素材
     *
     * @param sysReportMaterial 报告素材
     * @return 结果
     */
    @Override
    public int insertSysReportMaterial(SysReportMaterial sysReportMaterial) {
        return sysReportMaterialMapper.insertSysReportMaterial(sysReportMaterial);
    }

    /**
     * 修改报告素材
     *
     * @param sysReportMaterial 报告素材
     * @return 结果
     */
    @Override
    public int updateSysReportMaterial(SysReportMaterial sysReportMaterial) {
        return sysReportMaterialMapper.updateSysReportMaterial(sysReportMaterial);
    }

    /**
     * 批量删除报告素材
     *
     * @param materialIds 需要删除的报告素材主键
     * @return 结果
     */
    @Override
    public int deleteSysReportMaterialByMaterialIds(Long[] materialIds) {
        return sysReportMaterialMapper.deleteSysReportMaterialByMaterialIds(materialIds);
    }

    /**
     * 删除报告素材信息
     *
     * @param materialId 报告素材主键
     * @return 结果
     */
    @Override
    public int deleteSysReportMaterialByMaterialId(Long materialId) {
        return sysReportMaterialMapper.deleteSysReportMaterialByMaterialId(materialId);
    }

    /**
     * 根据日期范围查询素材
     *
     * @param startDate 开始日期
     * @param endDate 结束日期
     * @return 报告素材集合
     */
    @Override
    public List<SysReportMaterial> selectSysReportMaterialByDateRange(String startDate, String endDate) {
        return sysReportMaterialMapper.selectSysReportMaterialByDateRange(startDate, endDate);
    }
}
